package com.west.xu.consumer.service;

import com.west.xu.consumer.domain.CombinationNum;
import com.west.xu.consumer.service.fallback.ConsumerServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * name :服务提供者注册的服务名称
 */
@FeignClient(name = "tencent-provider",
//        url = "http://127.0.0.1:8090",
        fallback = ConsumerServiceFallback.class)
public interface IConsumerService {

    @RequestMapping(value = "/factorial/{number}", method = RequestMethod.GET)
    Long factorial(@PathVariable("number") Long number) throws RuntimeException;

    @RequestMapping(value = "/combination", method = RequestMethod.POST)
    Long combination(@RequestBody CombinationNum combinationNum) throws RuntimeException;
}
